//===============================================================================
// Microsoft patterns & practices Enterprise Library Contribution
// Query Application Block
//===============================================================================

using System;
using System.Collections.Generic;
using EntLibContrib.Query.Configuration.Design;
using Microsoft.Practices.EnterpriseLibrary.Common.Configuration;
using Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ContainerModel;
using Microsoft.Practices.EnterpriseLibrary.Common.Configuration.Design;

namespace EntLibContrib.Query.Configuration
{
	/// <summary>
	/// Configuration data defining ParameterData. This configuration section defines the name and type
	/// of the IParameter class
	/// </summary>
	public class ParameterData : NameTypeConfigurationElement
	{
		/// <summary>
		/// Initializes a new instance of the <see cref="ParameterData"/> class.
		/// </summary>
		public ParameterData()
		{
		}

		/// <summary>
		/// Initializes a new instance of the <see cref="ParameterData"/> class.
		/// </summary>
		/// <param name="name">The parameter name.</param>
		/// <param name="type">The <see cref="P:Microsoft.Practices.EnterpriseLibrary.Common.Configuration.NameTypeConfigurationElement.Type"/> that this element is the configuration for.</param>
		protected ParameterData(string name, Type type)
			: base(name, type)
		{
		}
	
		/// <summary>
		/// Returns the <see cref="TypeRegistration" /> for the data provider.
		/// </summary>
		/// <remarks>
		/// The method at the <see cref="ParameterData"/> should not be called directly and is expected to
		/// be implemented by inheritors.  Since the <see cref="ParameterData"/> requires a default constructor for 
		/// serialization purposes, the class could not be made abstract.
		/// </remarks>
        /// <param name="name">The name to use when building references to child elements.</param>
		/// <returns>A <see cref="TypeRegistration"/> for the data provider</returns>
		public virtual IEnumerable<TypeRegistration> GetRegistrations(string name)
		{
			// Cannot make abstract for serialization reasons.
			throw new NotImplementedException("Must be implemented by subclasses.");
		}
	}
}
